package com.liranhui.items;

import java.util.ArrayList;

import com.liranhui.blocks.ModBlocksRegister;
import com.liranhui.mod.RanhuiMod;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Item.Properties;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.event.RegistryEvent;
import com.liranhui.tab.ModCreativeTab;


public class ModItemsRegister {
    private ModBlocksRegister       _blockRegister = null;
    private ArrayList<Item>         _items = null;
    private ModCreativeTab          _tab = null;

    public ModItemsRegister( ModBlocksRegister blockRegister ) {
        _blockRegister = blockRegister;
        _items = new ArrayList<Item>();
    }

    @SubscribeEvent
    public void registerBlocks(RegistryEvent.Register<Item> event) {
        _tab = new ModCreativeTab("ranhui");
        String[] itemNames = new String[] {"magic_bar"};
        for(Integer i = 0; i<1; ++i) {
            Properties props = new Item.Properties().tab(_tab);
            Item item = new Item(props);
            _items.add(item);
            item.setRegistryName(RanhuiMod.ModID, itemNames[i]);
            event.getRegistry().register(item);
        }
        _tab.setRepresentItem(_items.get(0));
        _blockRegister.registBlockItems(event.getRegistry());
    }

}
